/* Copyright (c) 2025 Beijing Semidrive Technology Corporation
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/** *****************************************************************************************************
 *  \file     McuExt_Cfg.h                                                                              *
 *  \brief    This file contains generated pre compile configuration file for                           *
 *            McuExt MCAL driver                                                                        *
 *                                                                                                      *
 * <table>                                                                                              *
 * <tr><th>Date                 <th>Version                                                             *
 * <tr><td>2025-03-25 19:03:22  <td>1.0.0 R                                                             *
 * </table>                                                                                             *
 *******************************************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif

#include "McuExt_PvtSens.h"
#include "Vd.h"
/********************************************************************************************************
 *                                      Include header files                                            *
 *******************************************************************************************************/

/********************************************************************************************************
 *                                 Private Macro definition                                             *
 *******************************************************************************************************/

/********************************************************************************************************
 *                                  Global Constant Declarations                                        *
 *******************************************************************************************************/
#define MCUEXT_START_SEC_CONFIG_DATA_UNSPECIFIED
#include "McuExt_MemMap.h"
/* Declaring PVT channel0's notification function */
extern void Pvt_Channel0Notification(McuExt_PvtChannelIdType channel, McuExt_PvtAlarmType alarm);
/* Declaring PVT channel1's notification function */
extern void Pvt_Channel1Notification(McuExt_PvtChannelIdType channel, McuExt_PvtAlarmType alarm);

/* Declaring VD's notification function */
extern void VoltageSFDetectionNotification(uint32_t intStatus);

/* Declaring VD's notification function */
extern void VoltageLPDetectionNotification(uint32_t intStatus);

const McuExt_PvtAlarmConfigType McuExt_PvtAlarmConfigTable[PVT_CHANNEL_NUMBER] =
{
    {
        /* configOption */
        0x7U,
        /* pvtNotification */
        Pvt_Channel0Notification,
        /* levelAlarm */
        {
            /* threshLow */ (float32)-40,
            /* threshHigh */(float32)150,
        },
        /* risingEdgeAlarm */
        {
            /* hyst */ (float32)125,
            /* alarm */(float32)100,
        },
        /* fallingEdgeAlarm */
        {
            /* hyst */ (float32)100,
            /* alarm */(float32)125,
        }
    },
    {
        /* configOption */
        0x7U,
        /* pvtNotification */
        Pvt_Channel1Notification,
        /* levelAlarm */
        {
            /* threshLow */ (float32)-40,
            /* threshHigh */(float32)150,
        },
        /* risingEdgeAlarm */
        {
            /* hyst */ (float32)125,
            /* alarm */(float32)100,
        },
        /* fallingEdgeAlarm */
        {
            /* hyst */ (float32)100,
            /* alarm */(float32)125,
        }
    }
};
const McuExt_VdCfgType Mcu_VdConfigTable[VD_NUM] =
{
    {
        /*base address*/
        .base = MCUEXT_APB_VD_SF_BASE,
        /*set VOLT_SEL*/
        {
            /*set vd vin0 sel thre*/
            0x58U,
            /*set vd vin1 sel thre*/
            0xd9U,
            /*set vd vin2 sel thre*/
            0xd9U,
            /*set vd vin3 sel thre*/
            0x58U,
        },
        /*set ov threshold*/
        {
            /*set vd vin0 ov thre*/
            0x66U,
            /*set vd vin1 ov thre*/
            0x55U,
            /*set vd vin2 ov thre*/
            0x55U,
            /*set vd vin3 ov thre*/
            0x88U,
        },
        /*set uv threshold*/
        {
            /*set vd vin0 uv thre*/
            0x88U,
            /*set vd vin1 uv thre*/
            0x44U,
            /*set vd vin2 uv thre*/
            0x44U,
            /*set vd vin3 uv thre*/
            0x88U,
        },
        /*set filter*/
        {
            /*set filter sample interval*/
            0xfU,
            /*set rising edge bandwidth*/
            0xfU,
            /*set failling edge bandwidth*/
            0x0U,
        },
        /*set int sta disable*/
        0xffffU,
        /* vdNotificationPtr */
        VoltageSFDetectionNotification,
        /*set the safety interrupt status bit enable value*/
        0x0U,
    },
    {
        /*base address*/
        .base = MCUEXT_APB_VD_LP_BASE,
        /*set VOLT_SEL*/
        {
            /*set vd vin0 sel thre*/
            0x5eU,
            /*set vd vin1 sel thre*/
            0xd9U,
            /*set vd vin2 sel thre*/
            0xd9U,
            /*set vd vin3 sel thre*/
            0xd9U,
        },
        /*set ov threshold*/
        {
            /*set vd vin0 ov thre*/
            0x88U,
            /*set vd vin1 ov thre*/
            0x55U,
            /*set vd vin2 ov thre*/
            0x55U,
            /*set vd vin3 ov thre*/
            0x55U,
        },
        /*set uv threshold*/
        {
            /*set vd vin0 uv thre*/
            0x88U,
            /*set vd vin1 uv thre*/
            0x44U,
            /*set vd vin2 uv thre*/
            0x44U,
            /*set vd vin3 uv thre*/
            0xddU,
        },
        /*set filter*/
        {
            /*set filter sample interval*/
            0xfU,
            /*set rising edge bandwidth*/
            0xfU,
            /*set failling edge bandwidth*/
            0x0U,
        },
        /*set int sta disable*/
        0xffffU,
        /* vdNotificationPtr */
        VoltageLPDetectionNotification,
        /*set the safety interrupt status bit enable value*/
        0x0U,
    }
};

#define MCUEXT_STOP_SEC_CONFIG_DATA_UNSPECIFIED
#include "McuExt_MemMap.h"
#ifdef __cplusplus
}
#endif
/* End of file */
